﻿<UserControl 
    x:Class="Imagin.Controls.Extended.CollectionEditor"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
    xmlns:local="clr-namespace:Imagin.Controls.Extended"
    xmlns:Controls.Common="clr-namespace:Imagin.Controls.Common;assembly=Imagin.Controls.Common"
    x:Name="PART_CollectionEditor">
    <Grid DataContext="{Binding ElementName=PART_CollectionEditor}">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*"/>
            <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>
        <ListBox
            BorderThickness="0"
            ItemContainerStyle="{Binding ItemContainerStyle}"
            ItemContainerStyleSelector="{Binding ItemContainerStyleSelector}"
            ItemsPanel="{Binding ItemsPanel}"
            ItemsSource="{Binding Collection}"
            ItemStringFormat="{Binding ItemStringFormat}"
            ItemTemplate="{Binding ItemTemplate}"
            ItemTemplateSelector="{Binding ItemTemplateSelector}"
            SelectedValue="{Binding SelectedItem, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
            SelectionMode="Single"/>
        <GridSplitter 
            Width="4" 
            ResizeBehavior="CurrentAndNext"
            HorizontalAlignment="Right"
            VerticalAlignment="Stretch"/>
        <local:PropertyGrid
            Grid.Column="1"
            GridLinesVisibility="{Binding GridLinesVisibility}"
            HeadersVisibility="{Binding HeadersVisibility}"
            SelectedObject="{Binding SelectedItem}"/>
    </Grid>
</UserControl>
